<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
<html><head><title>QDial Class Reference</title><style>h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm }
a:link { color: #004faf; text-decoration: none }
a:visited { color: #672967; text-decoration: none }
td.postheader { font-family: sans-serif }
tr.address { font-family: sans-serif }
body { background: #ffffff; color: black; }
</style></head><body><table border="0" cellpadding="0" cellspacing="0" width="100%"><tr /><td align="left" valign="top" width="32"><img align="left" border="0" height="32" src="images/rb-logo.png" width="32" /></td><td width="1">&#160;&#160;</td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a>&#160;&#183; <a href="classes.html"><font color="#004faf">All Classes</font></a>&#160;&#183; <a href="modules.html"><font color="#004faf">Modules</font></a></td></table><h1 align="center">QDial Class Reference<br /><sup><sup>[<a href="qtgui.html">QtGui</a> module]</sup></sup></h1><p>The QDial class provides a rounded range control (like a
speedometer or potentiometer). <a href="#details">More...</a></p>

<p>Inherits <a href="qabstractslider.html">QAbstractSlider</a>.</p><h3>Methods</h3><ul><li><div class="fn" /><b><a href="qdial.html#QDial">__init__</a></b> (<i>self</i>, QWidget&#160;<i>parent</i>&#160;=&#160;None)</li><li><div class="fn" />bool <b><a href="qdial.html#event">event</a></b> (<i>self</i>, QEvent&#160;<i>e</i>)</li><li><div class="fn" /><b><a href="qdial.html#initStyleOption">initStyleOption</a></b> (<i>self</i>, QStyleOptionSlider&#160;<i>option</i>)</li><li><div class="fn" />QSize <b><a href="qdial.html#minimumSizeHint">minimumSizeHint</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qdial.html#mouseMoveEvent">mouseMoveEvent</a></b> (<i>self</i>, QMouseEvent&#160;<i>me</i>)</li><li><div class="fn" /><b><a href="qdial.html#mousePressEvent">mousePressEvent</a></b> (<i>self</i>, QMouseEvent&#160;<i>me</i>)</li><li><div class="fn" /><b><a href="qdial.html#mouseReleaseEvent">mouseReleaseEvent</a></b> (<i>self</i>, QMouseEvent&#160;<i>me</i>)</li><li><div class="fn" />bool <b><a href="qdial.html#notchesVisible">notchesVisible</a></b> (<i>self</i>)</li><li><div class="fn" />int <b><a href="qdial.html#notchSize">notchSize</a></b> (<i>self</i>)</li><li><div class="fn" />float <b><a href="qdial.html#notchTarget">notchTarget</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qdial.html#paintEvent">paintEvent</a></b> (<i>self</i>, QPaintEvent&#160;<i>pe</i>)</li><li><div class="fn" /><b><a href="qdial.html#resizeEvent">resizeEvent</a></b> (<i>self</i>, QResizeEvent&#160;<i>re</i>)</li><li><div class="fn" /><b><a href="qdial.html#setNotchesVisible">setNotchesVisible</a></b> (<i>self</i>, bool&#160;<i>visible</i>)</li><li><div class="fn" /><b><a href="qdial.html#setNotchTarget">setNotchTarget</a></b> (<i>self</i>, float&#160;<i>target</i>)</li><li><div class="fn" /><b><a href="qdial.html#setWrapping">setWrapping</a></b> (<i>self</i>, bool&#160;<i>on</i>)</li><li><div class="fn" />QSize <b><a href="qdial.html#sizeHint">sizeHint</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qdial.html#sliderChange">sliderChange</a></b> (<i>self</i>, QAbstractSlider.SliderChange&#160;<i>change</i>)</li><li><div class="fn" />bool <b><a href="qdial.html#wrapping">wrapping</a></b> (<i>self</i>)</li></ul><a name="details" /><hr /><h2>Detailed Description</h2><p>The QDial class provides a rounded range control (like a
speedometer or potentiometer).</p>
<p>QDial is used when the user needs to control a value within a
program-definable range, and the range either wraps around (for
example, with angles measured from 0 to 359 degrees) or the dialog
layout needs a square widget.</p>
<p>Since QDial inherits from <a href="qabstractslider.html">QAbstractSlider</a>, the dial behaves in a
similar way to a <a href="qslider.html">slider</a>. When <a href="qdial.html#wrapping-prop">wrapping</a>() is false (the default
setting) there is no real difference between a slider and a dial.
They both share the same signals, slots and member functions. Which
one you use depends on the expectations of your users and on the
type of application.</p>
<p>The dial initially emits <a href="qabstractslider.html#valueChanged">valueChanged</a>() signals
continuously while the slider is being moved; you can make it emit
the signal less often by disabling the <a href="qabstractslider.html#tracking-prop">tracking</a> property. The
<a href="qabstractslider.html#sliderMoved">sliderMoved</a>() signal
is emitted continuously even when tracking is disabled.</p>
<p>The dial also emits <a href="qabstractslider.html#sliderPressed">sliderPressed</a>() and
<a href="qabstractslider.html#sliderReleased">sliderReleased</a>()
signals when the mouse button is pressed and released. Note that
the dial's value can change without these signals being emitted
since the keyboard and wheel can also be used to change the
value.</p>
<p>Unlike the slider, QDial attempts to draw a "nice" number of
notches rather than one per line step. If possible, the number of
notches drawn is one per line step, but if there aren't enough
pixels to draw every one, QDial will skip notches to try and draw a
uniform set (e.g. by drawing every second or third notch).</p>
<p>Like the slider, the dial makes the <a href="qabstractslider.html">QAbstractSlider</a> functions <a href="qabstractslider.html#value-prop">setValue</a>(), <a class="compat" href="qabstractslider-qt3.html#addLine">addLine</a>(),
<a class="compat" href="qabstractslider-qt3.html#subtractLine">subtractLine</a>(), <a class="compat" href="qabstractslider-qt3.html#addPage">addPage</a>() and
<a class="compat" href="qabstractslider-qt3.html#subtractPage">subtractPage</a>() available as slots.</p>
<p>The dial's keyboard interface is fairly simple: The
<b>left</b>/<b>up</b> and <b>right</b>/<b>down</b> arrow keys
adjust the dial's <a href="qabstractslider.html#value-prop">value</a> by the defined <a href="qabstractslider.html#singleStep-prop">singleStep</a>, <b>Page
Up</b> and <b>Page Down</b> by the defined <a href="qabstractslider.html#pageStep-prop">pageStep</a>, and the
<b>Home</b> and <b>End</b> keys set the value to the defined
<a href="qabstractslider.html#minimum-prop">minimum</a> and
<a href="qabstractslider.html#maximum-prop">maximum</a> values.</p>
<p>If you are using the mouse wheel to adjust the dial, the
increment value is determined by the lesser value of <a href="qapplication.html#wheelScrollLines-prop">wheelScrollLines</a>
multipled by <a href="qabstractslider.html#singleStep-prop">singleStep</a>, and <a href="qabstractslider.html#pageStep-prop">pageStep</a>.</p>
<table class="generic">
<tr class="odd" valign="top">
<td><img alt="Screenshot of a dial in the Plastique widget style" src="images/plastique-dial.png" /></td>
<td><img alt="Screenshot of a dial in the Windows XP widget style" src="images/windowsxp-dial.png" /></td>
<td><img alt="Screenshot of a dial in the Macintosh widget style" src="images/macintosh-dial.png" /></td>
</tr>
<tr class="even" valign="top">
<td colspan="3">Dials shown in various widget styles (from left to
right): <a href="gallery-plastique.html">Plastique</a>, <a href="gallery-windowsxp.html">Windows XP</a>, <a href="gallery-macintosh.html">Macintosh</a>.</td>
</tr>
</table>
<hr /><h2>Method Documentation</h2><h3 class="fn"><a name="QDial" />QDial.__init__ (<i>self</i>, <a href="qwidget.html">QWidget</a>&#160;<i>parent</i>&#160;=&#160;None)</h3><p>The <i>parent</i> argument, if not None, causes <i>self</i> to be owned by Qt instead of PyQt.</p><p>Constructs a dial.</p>
<p>The <i>parent</i> argument is sent to the <a href="qabstractslider.html">QAbstractSlider</a> constructor.</p>


<h3 class="fn"><a name="event" />bool QDial.event (<i>self</i>, <a href="qevent.html">QEvent</a>&#160;<i>e</i>)</h3><p>Reimplemented from <a href="qobject.html#event">QObject.event</a>().</p>


<h3 class="fn"><a name="initStyleOption" />QDial.initStyleOption (<i>self</i>, <a href="qstyleoptionslider.html">QStyleOptionSlider</a>&#160;<i>option</i>)</h3><p>Initialize <i>option</i> with the values from this <a href="qdial.html">QDial</a>. This method is useful for subclasses when
they need a <a href="qstyleoptionslider.html">QStyleOptionSlider</a>, but don't want to
fill in all the information themselves.</p>
<p><b>See also</b> <a href="qstyleoption.html#initFrom">QStyleOption.initFrom</a>().</p>


<h3 class="fn"><a name="minimumSizeHint" /><a href="qsize.html">QSize</a> QDial.minimumSizeHint (<i>self</i>)</h3><p>Reimplemented from <a href="qwidget.html#minimumSizeHint-prop">QWidget.minimumSizeHint</a>().</p>


<h3 class="fn"><a name="mouseMoveEvent" />QDial.mouseMoveEvent (<i>self</i>, <a href="qmouseevent.html">QMouseEvent</a>&#160;<i>me</i>)</h3><p>Reimplemented from <a href="qwidget.html#mouseMoveEvent">QWidget.mouseMoveEvent</a>().</p>


<h3 class="fn"><a name="mousePressEvent" />QDial.mousePressEvent (<i>self</i>, <a href="qmouseevent.html">QMouseEvent</a>&#160;<i>me</i>)</h3><p>Reimplemented from <a href="qwidget.html#mousePressEvent">QWidget.mousePressEvent</a>().</p>


<h3 class="fn"><a name="mouseReleaseEvent" />QDial.mouseReleaseEvent (<i>self</i>, <a href="qmouseevent.html">QMouseEvent</a>&#160;<i>me</i>)</h3><p>Reimplemented from <a href="qwidget.html#mouseReleaseEvent">QWidget.mouseReleaseEvent</a>().</p>


<h3 class="fn"><a name="notchesVisible" />bool QDial.notchesVisible (<i>self</i>)</h3><h3 class="fn"><a name="notchSize" />int QDial.notchSize (<i>self</i>)</h3><h3 class="fn"><a name="notchTarget" />float QDial.notchTarget (<i>self</i>)</h3><h3 class="fn"><a name="paintEvent" />QDial.paintEvent (<i>self</i>, <a href="qpaintevent.html">QPaintEvent</a>&#160;<i>pe</i>)</h3><p>Reimplemented from <a href="qwidget.html#paintEvent">QWidget.paintEvent</a>().</p>


<h3 class="fn"><a name="resizeEvent" />QDial.resizeEvent (<i>self</i>, <a href="qresizeevent.html">QResizeEvent</a>&#160;<i>re</i>)</h3><p>Reimplemented from <a href="qwidget.html#resizeEvent">QWidget.resizeEvent</a>().</p>


<h3 class="fn"><a name="setNotchesVisible" />QDial.setNotchesVisible (<i>self</i>, bool&#160;<i>visible</i>)</h3><p>This method is also a Qt slot with the C++ signature <tt>void setNotchesVisible(bool)</tt>.</p><h3 class="fn"><a name="setNotchTarget" />QDial.setNotchTarget (<i>self</i>, float&#160;<i>target</i>)</h3><h3 class="fn"><a name="setWrapping" />QDial.setWrapping (<i>self</i>, bool&#160;<i>on</i>)</h3><p>This method is also a Qt slot with the C++ signature <tt>void setWrapping(bool)</tt>.</p><h3 class="fn"><a name="sizeHint" /><a href="qsize.html">QSize</a> QDial.sizeHint (<i>self</i>)</h3><p>Reimplemented from <a href="qwidget.html#sizeHint-prop">QWidget.sizeHint</a>().</p>


<h3 class="fn"><a name="sliderChange" />QDial.sliderChange (<i>self</i>, <a href="qabstractslider.html#SliderChange-enum">QAbstractSlider.SliderChange</a>&#160;<i>change</i>)</h3><p>Reimplemented from <a href="qabstractslider.html#sliderChange">QAbstractSlider.sliderChange</a>().</p>
<h3 class="fn"><a name="wrapping" />bool QDial.wrapping (<i>self</i>)</h3><address><hr /><div align="center"><table border="0" cellspacing="0" width="100%"><tr class="address"><td align="left" width="25%">PyQt&#160;4.9.1 for X11</td><td align="center" width="50%">Copyright &#169; <a href="http://www.riverbankcomputing.com">Riverbank&#160;Computing&#160;Ltd</a> and <a href="http://www.qtsoftware.com">Nokia</a> 2011</td><td align="right" width="25%">Qt&#160;4.8.0</td></tr></table></div></address></body></html>